package cosc617_blackteam;

/**
 * @author Laura
 * This seating strategy first tries seating with the pull apart strategy
 * and if that fails then it will try the push together strategy
 */
public class PushAndPullTableStrat implements I_SeatingStrategy {

	TableCollections tableList;
	I_SeatingStrategy pull, push;

	public PushAndPullTableStrat(TableCollections tableList) {
		this.tableList = tableList;
		push = new PushTablesTogetherStrategy(tableList);
		pull = new SplitTableSeatingStrategy(tableList);
	}

	@Override
	public boolean addParty(CustomerParty party) {

		if (pull.addParty(party))
			return true;

		// else
		return push.addParty(party);

	}

}
